package javaclickers.javaclickers.mobile;

public class SingletonParameters {
	private static SingletonParameters singletonObject;
	private Parameters parametros;

	private SingletonParameters() {
	}

	private SingletonParameters(String ip, MainActivity mainActivity) {
		setParametros(new Parameters(ip, mainActivity));
	}

	public static synchronized SingletonParameters getSingletonParameters(
			String ip, MainActivity mainActivity) {
		singletonObject = new SingletonParameters(ip, mainActivity);
		return singletonObject;
	}

	public static synchronized SingletonParameters getSingletonParameters() {
		return singletonObject;
	}

	public Parameters getParametros() {
		return parametros;
	}

	public void setParametros(Parameters parametros) {
		this.parametros = parametros;
	}

	public void closeParameters() {
		this.parametros.cerrarConexiones();
		singletonObject = null;
	}

}
